home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 22 / q22.d81 / t.slide poker < prev    next >
Text File  |  2022-08-28  |  16KB  |  331 lines

  1.  
  2.  
  3.                     SLIDE POKER 128 AND CONTROL80-C V1.1
  4.                                       
  5.                                by Jon Mattson
  6.                                       
  7.     (SLIDE POKER is based on a game by Maurice Jones and Fender Tucker)
  8.  
  9.  
  10.      Some time ago, while I was working on an 80-column Crazy Eights game
  11. for LS128, I decided to design a few standard routines that would simplify
  12. the creation of card games in general.  My first priority was to have
  13. large, crisp cards which would, nevertheless, be drawn quickly on the
  14. screen.  I also wanted the shuffle routine to be virtually instantaneous
  15. and the whole package to work with Control80, since I never program on the
  16. 80-column screen without that utility, these days.  (Fender says much the
  17. same.  All modesty aside, if you are a C128 programmer working with the 80-
  18. column screen you may want to try it out, too: it makes life much simpler.
  19. Plug, plug...)  It soon became clear that what I really needed to do was
  20. create a new version of Control80, specifically designed for card games,
  21. and that is exactly what I did.
  22.  
  23.      After the game was published, Fender took a look at the code and grew
  24. curious about the previously unseen keywords contained therein, so I filled
  25. him in on the new version of Control80, C80-C.  He realized, showing more
  26. foresight than I'm afraid I had displayed, that a lot of other people might
  27. find it handy if they knew how to use it, so he asked me to come up with
  28. another card game, specifically designed to showcase C80-C.  I was a bit
  29. stumped at first, because I wanted to do a card game unlike anything which
  30. had previously appeared on LS 128.  Fender soon came to the rescue again,
  31. though: he and Maurice Jones had recently finished a game for the C-64
  32. which he thought could be ported over to LS 128 with good effect.  Thus was
  33. born SLIDE POKER 128.
  34.  
  35.      There is really little more to be said about the game, since you can
  36. read all about it from within the program itself, simply by pressing 'R'.
  37. This is listed on the main screen, so you don't even have to remember that.
  38. The rest of this article will be devoted, instead, to C80-C and how you can
  39. make use of it.  Much of the following information will be familiar to
  40. those who have used Control80 before; however, it has been repeated here
  41. for those who have not.  Even veteran users should look this over and take
  42. note: for reasons of space, this run-time version does not include five of
  43. the old commands, namely DUMP, HOME, LCLEAR, VSAVE and MINE.  On the other
  44. hand, three new commands -- CARD, DICE and SHUF -- have been added, and
  45. FILL has been improved.  Also note that this version of C80-C (V1.1)
  46. supersedes the version which accompanied CRAZY EIGHTS (V1.0), since it
  47. improves upon the latter by adding Jokers to the deck.
  48.  
  49.      First of all, a quick overview is in order for those who have no idea
  50. what Control80 and its close cousin, C80-C, are all about.  Control80 is an
  51. extension of the BASIC 7.0 which adds many new keywords to the language.
  52. These new functions and commands are specifically designed to make using
  53. the 80-column screen easier.  Those who have tried to work with 80-columns
  54. in BASIC 7.0 will realize just what a boon this is: you can't even PEEK or
  55. POKE to the VDC with normal BASIC!  Control80 solves that problem and many
  56. others, as well.
  57.  
  58.      Using C80-C is simple.  First, set aside a section of memory to hold
  59. it by opening up the area normally used for hires graphics.  GRAPHIC1,1
  60. will accomplish this, although it should be followed by GRAPHIC0,1 to get
  61. out of hires mode and GRAPHIC5 to return the screen editor controls to the
  62. 80-column screen.  Then, just BLOAD C80-C into memory and SYS 4864, either
  63. in direct mode or early on in your program.  Generally a simple BLOAD will
  64. suffice, but, if you have been playing around with BANKs and the like, you
  65. might want to use the full syntax.  To summarize:
  66.  
  67.      GRAPHIC1,1:GRPAHIC0,1:GRAPHIC5:BLOAD"C80-C",B0,P4864:SYS4864
  68.  
  69.      Unlike Control80, C80-C comes with a built-in, card-oriented font,
  70. which can be moved to VDC memory with a simply FCOPY 6880,0,1.  This
  71. command will cause the new font to replace the existing alternate
  72. (upper/lower case) font, so that you can use the CARD command.  Once the
  73. font is in place, you can freely overwrite the area it previously occupied
  74. and even 'collapse' the graphic area with GRAPHICCLR to free up more
  75. program space if you wish, since C80-C, itself, resides below this area.
  76. As an aside, this is why you must open a graphics area for C80-C, whereas
  77. you do not need to do so with Control80.  For obvious reasons, the FCOPY
  78. should come very shortly after the set-up commands previously mentioned;
  79. however, it should not be on the same line as those commands.  The reason
  80. for this is that the computer deciphers keywords a line at a time, and,
  81. until the SYS 4864 has actually been acted upon, the FCOPY command will be
  82. translated as gibberish, resulting in a syntax error when that point in the
  83. line is reached.
  84.  
  85.      Once C80-C is installed, the new keywords can be used just like any
  86. other BASIC commands.  You can even abbreviate them by shifting the second
  87. letter, as usual.  Remember that C80-C must be active (not just resident)
  88. while you type in a program using its keywords, or they will not be
  89. tokenized correctly.  Note, also, that C80-C uses memory from 4864 to 6879
  90. (once the font has been moved), so avoid POKEing around this area.
  91.  
  92.      Hitting the beloved STOP/RESTORE combination will not deactivate C80-
  93. C.  The QUIT command (previously unimplemented on the 128) will turn it
  94. off, although SYS 4864 will bring it back to life.  Resetting the computer
  95. will also turn it off; however, due to its location, C80-C will still be
  96. resident for later use, as long as you haven't POKEd over its memory space.
  97. In this case, however, the font will likely be lost.
  98.  
  99.      Now let's look at your new resources.  Certain conventions have been
  100. followed in this listing.  Memory addresses are 0-65535, as usual, to allow
  101. use with both 16K and 64K VDCs.  Note, however, that addresses above 16383
  102. wrap around on the 16K chip, i.e. 16384 = 0.  Remember that the basic 8563
  103. chip is set up as follows:
  104.  
  105.      $0000 - 07FF        0 - 2047     Screen
  106.      $0800 - 0FFF     2048 - 4095     Attributes
  107.      $1000 - 1FFF     4096 - 8191     Unused
  108.      $2000 - 2FFF     8192 - 12287    Upper Case/Graphic (normal) Font
  109.      $3000 - 3FFF    12288 - 16383    Upper/Lower Case (alternate) Font
  110.  
  111.       VDC register numbers (reg# below) range from 0-36.  It is not within
  112. the scope of this article to explain the use of every register, but a
  113. simplified listing is given in the previous Control80 article, and a
  114. complete description can be found in the C-128 Programmer's Reference
  115. Guide.  When in doubt, experiment with the WVD command, but be sure that
  116. you check the register's normal value first with the RVD function to set
  117. things back to normal!
  118.  
  119.  
  120.                             ***  FUNCTIONS  ***
  121.  
  122. PEER (VDC address)
  123.  
  124.      This function allows you to check the contents of VDC memory.  It
  125. operates just like BASIC's PEEK.  For example, to find the character in the
  126. top left corner of the screen, PRINT PEER(0).  Note that PEER is the
  127. counterpart of POST, below.
  128.  
  129.  
  130. RVD (reg#)
  131.  
  132.      This function (Read ViDeo register) allows you to check the contents
  133. of any of the 37 VDC registers.  For example, A=RVD(12) would put the
  134. contents of register 12 into the variable A.  Note that RVD is the
  135. counterpart of WVD, below.
  136.  
  137.  
  138.                              ***  COMMANDS  ***
  139.  
  140. BLOCK VDC address, number, value
  141.  
  142.      This command allows you to fill any small section of VDC memory with a
  143. single value.  "Address" indicates the starting position of the fill, and
  144. "number" (2-255) indicates how many consecutive locations to fill with the
  145. specified "value" (0-255), from that point on.  One of the best uses of
  146. BLOCK is to highlight a line on the screen by filling attribute memory with
  147. a different color value and/or reverse.  For example, BLOCK 2048,80,72
  148. would highlight the entire first line of the screen by coloring it red and
  149. using reverse characters.  See FILL for more information on attribute
  150. memory.
  151.  
  152.  
  153. CARD top